#! /bin/bash

MY_ORIENTATION=$(identify -format '%[exif:orientation]' $1 )

case $MY_ORIENTATION in
	1) echo -e "landscape\t$MY_ORIENTATION\t$1" ;;
	3) echo -e "landscape r\t$MY_ORIENTATION\t$1" ;;
	6) echo -e "portrait\t$MY_ORIENTATION\t$1" ;;
    8) echo -e "portrait r\t$MY_ORIENTATION\t$1" ;;
    *) echo -e "unknown\t$MY_ORIENTATION\t$1" ;;
esac

